/**
 * @author casazaft
 */
Package("xclab.mvc.core").Class("Model",{
	Model:function(){
		             this.proxyMap = [];
            this.initializeModel();
        },
        Prototype: {
            initializeModel: function(){
            
            },
            registerProxy: function(proxy){
                this.proxyMap[proxy.getProxyName()] = proxy;
                proxy.onRegister();
            },
            retrieveProxy: function(proxyName){
                return this.proxyMap[proxyName];
            },
            hasProxy: function(proxyName){
                return this.proxyMap.hasOwnProperty(proxyName);
            },
            removeProxy: function(proxyName){
                var proxy = this.proxyMap[proxyName];
                if (proxy) {
                    delete this.proxyMap[proxyName];
                    proxy.onRemove();
                }
                return proxy;
            }
        },
        Extends: j2j.patterns.Singleton
    })
